package com.numberone.master.modules.rsa.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.numberone.master.common.persistence.Page;
import com.numberone.master.common.service.CrudService;
import com.numberone.master.modules.rsa.entity.Ips;
import com.numberone.master.modules.sys.utils.UserUtils;
import com.numberone.master.modules.rsa.dao.IpsDao;

/**
 * ip地址Service
 * @author ck
 * @version 2018-03-01
 */
@Service
@Transactional(readOnly = true)
public class IpsService extends CrudService<IpsDao, Ips> {
	
	@Autowired
	private IpsDao ipsDao;
	
	public Ips get(String id) {
		return super.get(id);
	}
	
	public List<Ips> findList(Ips ips) {
		return super.findList(ips);
	}
	
	public Page<Ips> findPage(Page<Ips> page, Ips ips) {
		return super.findPage(page, ips);
	}
	
	@Transactional(readOnly = false)
	public void save(Ips ips) {
		super.save(ips);
	}

	@Transactional(readOnly = false)
	public void update(Ips ips) {
		super.update(ips);
	}
	
	@Transactional(readOnly = false)
	public void delete(Ips ips) {
		super.delete(ips);
	}
	
	public Ips isIps(String ip){
		String id = UserUtils.getUser().getId();
		return ipsDao.isIps(ip,id);
	}
	
}